package com.game.character;

import java.util.Random;

import com.game.character.TypeCharacter.TypeObject;
import com.game.framwork.itf.Graphics;

public class Mobs extends Character{

	public static int MOB_MUMMY = 0;	
	public static int MOB_BOSS = 1;
	public static int MOB_BAT = 2;
	public static int MOB_MUMMYRAGE = 3;
	public static int MOB_BOSSRAGE = 4;
	public int mobType;
	public float dieTime;
	public float maxDieTime;
	public float timeToChangeDir;

	public Mobs() {
		initInfo();
	}
	
	public void initInfo() {
		type = TypeObject.Enemy;
		timeMaxDelayShot = 3f;
		this.runSpeed = 3.0f;
		maxDieTime = 1.0f;
		timeToChangeDir = 0.0f;
		isDeath = false;
		isDying = false;
	}
	
	public void changeMoveState() {
		switch (currState) {
		case MOVE_LEFT:
			changeAnimation("Move Left");
			currentSpeed = -runSpeed;
			break;
		case MOVE_RIGHT:
			changeAnimation("Move Right");
			currentSpeed = +runSpeed;
			break;
		case MOVE_TOP:
			changeAnimation("Move Top");
			currentSpeed = -runSpeed;
			break;
		case MOVE_BOTTOM:
			changeAnimation("Move Bot");
			currentSpeed = +runSpeed;
			break;
		}
	}
	
	public void randomMove() {
		if (isChangeDir) {
			Random random = new Random();
			isChangeDir = false;
			currState = random.nextInt(4) + 1;
			timeToChangeDir = 0;
		} else {
			if (timeToChangeDir >= 1.0f) {
				Random random = new Random();
				currState = random.nextInt(4) + 1;
				timeToChangeDir = 0;
			}
		}		
		changeMoveState();
		move(currentSpeed);
	}
	
	@Override
	public void updateInternal(float deltaTime) {
		super.updateInternal(deltaTime);
	}

	@Override
	public void paintInternal(Graphics g) {
		super.paintInternal(g);
	}
	
	@Override
	public void move(float speed) {
		super.move(speed);
	}
}
